package org.hope.web.listner;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.hope.handlers.ServiceHandler;
import org.hope.service.ManagerService;
import org.hope.util.HopeLogger;

public class ContextListner implements ServletContextListener
{
	private List<ManagerService> managers = new ArrayList<ManagerService>();

	public void contextInitialized( ServletContextEvent arg0 )
	{
		String catBase = System.getProperty( "catalina.base" );

		HopeLogger.log( "Catalina Base :" + catBase );
//		String serverConfPath = catBase + File.separator + "conf" + File.separator + "hope.conf";

		managers.add( ( ManagerService ) ( ServiceHandler.getHopeSmartService() ) );

		for ( ManagerService service : managers )
		{
			service.init();
		}

	}

	public void contextDestroyed( ServletContextEvent arg0 )
	{
	}

}
